#include "Effect.h"

const AssetType RE_Effect::m_EffectType = "Effect";

RE_Effect::RE_Effect(Resource Res) : m_Source(Res)
{
	pd3dEffect = NULL;
}
RE_Effect::~RE_Effect()
{
	if(this->pd3dEffect == NULL)
	{
		return;
	}
	RandomEngineApp::Get()->GetRenderer()->VReleaseEffect(this);
}

bool RE_Effect::Restore()
{
	if(this->pd3dEffect == NULL)
	{
		RandomEngineApp::Get()->GetRenderer()->VCreateEffect(this);
	}
	return true;
}

bool RE_Effect::Release()
{
	if(this->pd3dEffect != NULL)
	{
		RandomEngineApp::Get()->GetRenderer()->VReleaseEffect(this);
	}
	return true;
}